home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / docume1a / frmopend (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-09-10  |  2.8 KB  |  97 lines

  1. VERSION 5.00
  2. Object = "{3B7C8863-D78F-101B-B9B5-04021C009402}#1.1#0"; "RICHTX32.OCX"
  3. Begin VB.Form frmOpenDoc 
  4.    Caption         =   "New Document"
  5.    ClientHeight    =   5115
  6.    ClientLeft      =   60
  7.    ClientTop       =   345
  8.    ClientWidth     =   6150
  9.    ClipControls    =   0   'False
  10.    LinkTopic       =   "Form1"
  11.    LockControls    =   -1  'True
  12.    MDIChild        =   -1  'True
  13.    ScaleHeight     =   5115
  14.    ScaleWidth      =   6150
  15.    Visible         =   0   'False
  16.    Begin RichTextLib.RichTextBox RichTextBox1 
  17.       Height          =   4815
  18.       Left            =   0
  19.       TabIndex        =   0
  20.       Top             =   120
  21.       Width           =   10000
  22.       _ExtentX        =   17648
  23.       _ExtentY        =   8493
  24.       _Version        =   327681
  25.       ScrollBars      =   2
  26.       DisableNoScroll =   -1  'True
  27.       TextRTF         =   $"frmOpenDoc.frx":0000
  28.    End
  29. Attribute VB_Name = "frmOpenDoc"
  30. Attribute VB_GlobalNameSpace = False
  31. Attribute VB_Creatable = False
  32. Attribute VB_PredeclaredId = True
  33. Attribute VB_Exposed = False
  34. Private Sub Form_Load()
  35. Width = 0.9 * Screen.Width
  36. Height = 0.6 * Screen.Height
  37. RichTextBox1.RightMargin = RichTextBox1.Width
  38. End Sub
  39. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
  40. If boolnew = True And boolsave = True Then
  41. Response = MsgBox("  Do You Want To Save Changes?", vbQuestion + vbYesNoCancel)
  42. MDIForm1.CommonDialog2.CancelError = True
  43. On Error GoTo ErrHandler
  44. Select Case Response
  45. Case vbYes
  46. On Error GoTo ErrHandler
  47. MDIForm1.CommonDialog2.Flags = &H2 'File exists
  48. MDIForm1.CommonDialog2.ShowSave
  49. frmOpenDoc.RichTextBox1.SaveFile MDIForm1.CommonDialog2.filename
  50. boolsave = False
  51. ControlsDisabled
  52. Case vbNo
  53. ControlsDisabled
  54. End Select
  55. If boolsave = True Then
  56. Response = MsgBox("  Do You Want To Save Changes?", vbQuestion + vbYesNoCancel)
  57. MDIForm1.CommonDialog2.CancelError = True
  58. On Error GoTo ErrHandler
  59. Select Case Response
  60. Case vbYes
  61. Call SaveDoc
  62. If bCannotSave = False Then
  63. ControlsDisabled
  64. End If
  65. Case vbNo
  66. ControlsDisabled
  67. End Select
  68. ControlsDisabled
  69. End If
  70. End If
  71. ErrHandler:
  72. Cancel = True
  73. End Sub
  74. Private Sub Form_Resize()
  75. RichTextBox1.Height = ScaleHeight
  76. RichTextBox1.Width = ScaleWidth
  77. If (Me.WindowState = 1 Or Me.WindowState = 2) Then Exit Sub
  78. If Me.Height < 5000 Then
  79.     Me.Height = 5000
  80. End If
  81. If Me.Width < 7000 Then
  82.     Me.Width = 10000
  83. End If
  84. End Sub
  85. Private Sub RichTextBox1_Change()
  86. If RichTextBox1.SelLength > 0 Then
  87. MDIForm1.mnuSave.Enabled = True
  88. MDIForm1.Toolbar1.Buttons(3).Enabled = True
  89. MDIForm1.mnuSaveAs.Enabled = True
  90. MDIForm1.Toolbar1.Buttons(4).Enabled = True
  91. boolsave = True
  92. End If
  93. End Sub
  94. Private Sub RichTextBox1_KeyDown(KeyCode As Integer, Shift As Integer)
  95. Call RichTextKeyDown
  96. End Sub
  97.